package com.hutu.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hutu.model.dto.useranswer.UserAnswerQueryRequest;
import com.hutu.model.entity.AccountAnswer;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hutu.model.vo.UserAnswerVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 20272
* @description 针对表【account_answer(用户答题记录)】的数据库操作Service
* @createDate 2024-08-12 20:39:03
*/
public interface AccountAnswerService extends IService<AccountAnswer> {

    /**
     * 校验数据
     *
     * @param userAnswer
     * @param add 对创建的数据进行校验
     */
    void validUserAnswer(AccountAnswer userAnswer, boolean add);

    /**
     * 获取查询条件
     *
     * @param userAnswerQueryRequest
     * @return
     */
    QueryWrapper<AccountAnswer> getQueryWrapper(UserAnswerQueryRequest userAnswerQueryRequest);

    /**
     * 获取用户答案封装
     *
     * @param userAnswer
     * @param request
     * @return
     */
    UserAnswerVO getUserAnswerVO(AccountAnswer userAnswer, HttpServletRequest request);

    /**
     * 分页获取用户答案封装
     *
     * @param userAnswerPage
     * @param request
     * @return
     */
    Page<UserAnswerVO> getUserAnswerVOPage(Page<AccountAnswer> userAnswerPage, HttpServletRequest request);
}
